package com.one.blocks.security.enums;

import com.one.blocks.common.enums.CodeMsgEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author linfuxin Created on 2022-02-14 10:40:49
 */
@Getter
@AllArgsConstructor
public enum SecurityExceptionEnum implements CodeMsgEnum {

    /**
     * 无token或token失效
     */
    NO_ACCESS_TOKEN(1000, "用户未登录或会话已过期"),

    NO_CREDENTIALS(1001, "用户名或密码错误"),

    BAD_CREDENTIALS(1002, "用户名或密码错误"),

    /**
     * 密码未加密
     */
    ILLEGAL_CREDENTIALS(1003, "密码格式错误"),

    EXPIRED_CREDENTIALS(1009, "密码已过期"),

    NO_SMS_CODE(1010, "验证码错误"),

    BAD_SMS_CODE(1011, "验证码错误"),


    NO_ACCOUNT(1020, "账号不存在"),

    DISABLED_ACCOUNT(1021, "账号被禁用"),

    LOCKED_ACCOUNT(1022, "账号被锁定"),

    EXPIRED_ACCOUNT(1023, "账号已过期"),

    NO_PERMISSION(1900, "用户无权限访问"),

    ;

    private final int code;
    private final String msg;
}
